package org.example.enums;

import java.io.File;
import java.time.LocalDate;
import java.util.UUID;

/**
 * 文件类型枚举类
 * @author Admin
 *
 */
public enum FileTypeEnum {

    file("file" + File.separator), video("video" + File.separator), image("image" + File.separator),
    temp("temp" + File.separator), bak("bak" + File.separator), base("base" + File.separator),
    upload("upload" + File.separator), trans("trans" + File.separator);
    private String path;

    private FileTypeEnum(String path) {
        this.setPath(path);
    }

    public String getPath() {
        return path;
    }
    
    public static String getConvertPath() {
        String basePath = "convert" + File.separator;
//        FileUtils.mkdirs(basePath);
        return basePath + System.currentTimeMillis() + ".mp4";
    }

    public String getTodayPath() {
        String basePath = path + LocalDate.now() + File.separator;
//        FileUtils.mkdirs(basePath);
        return basePath + UUID.randomUUID().toString().replaceAll("-","");
    }

    public void setPath(String path) {
        this.path = path;
    }

}
